<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span{
            display: inline-block;
            margin-left: 10px;
            width: 20px;
            height: 20px;
        }
    </style>
</head>
<body>
    <script>
        var arr=[]
        var arr1=[]
        var arr2=[]
        var arr3=[]
        var arr4=[]
        var arr5=[]
        for(i=1;i<=25;i++){
            if(i<=5){
                arr1.push(i)
            }else if(i>=6 && i<=10){
                arr2.push(i)
            }
            else if(i>=11 && i<=15){
                arr3.push(i)
            }
            else if(i>=16 && i<=20){
                arr4.push(i)
            }
            else if(i>=21 && i<=25){
                arr5.push(i)
            }
        }
        arr.push(arr1,arr2,arr3,arr4,arr5)
        console.log(arr1)
        console.log(arr2)
        console.log(arr3)
        console.log(arr4)
        console.log(arr5)
        console.log(arr)
        var sum
       for(var j=0;j<arr.length;j++){
           for(var k=0;k<=j;k++){
               
               sum=arr[j][k]
               document.write('<span>' + sum + '</span>')
            }
           
           document.write('<br>')
       }
    </script>
</body>
</html>